package com.bingo.mpa.pojo;

import java.util.Map;

import org.apache.commons.beanutils.BeanUtils;
import org.express.portal.persist.POJO;

public class Agent extends POJO
{
	private static final long serialVersionUID = 1L;
	private long aid;			
	private String name;
	private String fullname;
	private String legal_name;
	private String legal_tel;
	private String legal_mobile;
	private String legal_email;
	private String regist_address;
	private String com_address;
	private String contact;
	private String contact_tel;
	private String contact_mobile;
	private String contact_email;
	private int bankcard;
	
	public Agent()
	{
		super._this_table_name = "P_AGENT";
	}

	public long getAid()
	{
		return aid;
	}

	public void setAid(long aid)
	{
		this.aid = aid;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getFullname()
	{
		return fullname;
	}

	public void setFullname(String fullname)
	{
		this.fullname = fullname;
	}

	public String getLegal_name()
	{
		return legal_name;
	}

	public void setLegal_name(String legal_name)
	{
		this.legal_name = legal_name;
	}

	public String getLegal_tel()
	{
		return legal_tel;
	}

	public void setLegal_tel(String legal_tel)
	{
		this.legal_tel = legal_tel;
	}

	public String getLegal_mobile()
	{
		return legal_mobile;
	}

	public void setLegal_mobile(String legal_mobile)
	{
		this.legal_mobile = legal_mobile;
	}

	public String getLegal_email()
	{
		return legal_email;
	}

	public void setLegal_email(String legal_email)
	{
		this.legal_email = legal_email;
	}

	public String getRegist_address()
	{
		return regist_address;
	}

	public void setRegist_address(String regist_address)
	{
		this.regist_address = regist_address;
	}

	public String getCom_address()
	{
		return com_address;
	}

	public void setCom_address(String com_address)
	{
		this.com_address = com_address;
	}

	public String getContact()
	{
		return contact;
	}

	public void setContact(String contact)
	{
		this.contact = contact;
	}

	public String getContact_tel()
	{
		return contact_tel;
	}

	public void setContact_tel(String contact_tel)
	{
		this.contact_tel = contact_tel;
	}

	public String getContact_mobile()
	{
		return contact_mobile;
	}

	public void setContact_mobile(String contact_mobile)
	{
		this.contact_mobile = contact_mobile;
	}

	public String getContact_email()
	{
		return contact_email;
	}

	public void setContact_email(String contact_email)
	{
		this.contact_email = contact_email;
	}

	public int getBankcard()
	{
		return bankcard;
	}

	public void setBankcard(int bankcard)
	{
		this.bankcard = bankcard;
	}
	
	@SuppressWarnings("unchecked")
	protected Map<String, Object> listInsertableFields()
	{
		try
		{
			Map<String, Object> props = BeanUtils.describe(this);
			if (getId() <= 0)
			{
				if(props.containsKey("id"))
				{
					props.remove("id");
				}
				if(props.containsKey("aid"))
				{
					props.remove("aid");
				}
			}
			props.remove("class");
			return props;
		}
		catch (Exception e)
		{
			throw new RuntimeException("Exception when Fetching fields of " + this);
		}
	}
}
